Skip to content

perf(libSceAgc): snapshot WRITE_DATA payloads without heap allocation - #19802

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
AlexFigas:perf/agc-write-data-snapshot
Nov 14, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
AlexFigas:perf/agc-write-data-snapshot

Conversation

@AlexFigas

@AlexFigas AlexFigas commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

WriteData (behind sceAgcDcbWriteData and sceAgcAcbWriteData) copies the caller's payload before Allocate, because the out-of-space callback may rewrite or move the memory the payload points into. The copy was a std::vector, so every call made one heap allocation. Payloads of up to 64 dwords are now copied into stack storage, larger ones into a heap buffer as before. The copy is still taken before the callback runs.

testWriteDataReadsPayloadBeforeCallback in tests/CopyData.cpp puts the payload inside the buffer that the callback clobbers, with 4, 64, 65 and 100 dwords (both sides of the inline limit), for DCB and ACB. It fails if the snapshot is removed.

The same pattern in WriteRegisterRange / WriteRegisters (Packet.cpp) is left alone: #18914 already changes it.

Tested

Windows 11 Pro 26300, Ryzen 5 9600X, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh), Release.

  • All 35 libSceAgc CTests pass, including the new case.
  • Microbenchmark (best of 5 rounds of 5,000,000 calls, three interleaved runs each). Only libSceAgc.prx differs between the two runtimes:
main (c9a1545e8c) this PR
sceAgcDcbWriteData (4 dwords) 37.7 / 40.8 / 36.7 ns 18.3 / 17.5 / 18.2 ns
sceAgcDcbSetShRegisterDirect (unchanged, control) 31.5 / 32.1 / 31.7 ns 31.9 / 32.5 / 31.2 ns
  • Title trace: ASTRO BOT (PPSA21564), APS5_TRACE_SECONDS=200:20, three alternating main/change pairs on this machine with only libSceAgc.prx swapped. No frame-time change can be claimed (paired p50 gaps of 2.0, 0.8 and 0.4 ms that shrink with run order, and equal GPU busy time). Summary lines, the table and trace_digest.py output are in the comment below.
  • GPU tests agc_driver_frame_replay, agc_driver_pm4_replay and agc_driver_pm4_replay_tool on main and on this PR with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer, validation layer 1.4.368 (Khronos nightly 2026-11-13). Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation" and neither contains was not found but was requested by env var VK_INSTANCE_LAYERS. Both runs pass with 0 VUID- lines and 0 validation messages.
Benchmark source (not committed)
#include "prx/libSceAgc/DcbState/include/Registers.hpp"
#include "prx/libSceAgc/Cb/include/Registers.hpp"
#include "prx/libSceAgc/DcbFlow/include/Memory.hpp"
#include "prx/libc/include/Shutdown.hpp"

#include <array>
#include <chrono>
#include <cstdio>
#include <vector>

namespace {

std::vector<std::uint32_t> words(1u << 20);
CommandBuffer buffer{};

bool APS5_VABI rewind(CommandBuffer* target, std::uint32_t, void*) {
    target->cursor_up = target->bottom;
    target->cursor_down = target->top;
    return true;
}

template <typename TAction>
void measure(const char* name, std::uint64_t iterations, TAction action) {
    for (std::uint64_t i = 0; i < iterations / 10; ++i) action(i);
    double best = 1e30;
    for (int round = 0; round < 5; ++round) {
        const auto start = std::chrono::steady_clock::now();
        for (std::uint64_t i = 0; i < iterations; ++i) action(i);
        const auto elapsed = std::chrono::duration<double, std::nano>(std::chrono::steady_clock::now() - start).count() / static_cast<double>(iterations);
        if (elapsed < best) best = elapsed;
    }
    std::printf("%-40s %8.2f ns/call\n", name, best);
}

}

int main() {
    buffer = CommandBuffer{words.data(), words.data() + words.size(), words.data(), words.data() + words.size(), rewind, nullptr, 0};
    constexpr std::uint64_t Iterations = 5'000'000;
    measure("sceAgcDcbSetShRegisterDirect", Iterations, [](std::uint64_t i) {
        sceAgcDcbSetShRegisterDirect(&buffer, ShaderRegister{0x8c + static_cast<std::uint32_t>(i & 15), static_cast<std::uint32_t>(i)});
    });
    measure("sceAgcDcbSetCxRegisterDirect", Iterations, [](std::uint64_t i) {
        sceAgcDcbSetCxRegisterDirect(&buffer, ShaderRegister{0x100 + static_cast<std::uint32_t>(i & 15), static_cast<std::uint32_t>(i)});
    });
    std::array<std::uint32_t, 16> range{};
    measure("sceAgcCbSetShRegisterRangeDirect(16)", Iterations, [&](std::uint64_t i) {
        range[0] = static_cast<std::uint32_t>(i);
        sceAgcCbSetShRegisterRangeDirect(&buffer, 0x8c, range.data(), static_cast<std::uint32_t>(range.size()));
    });
    std::array<ShaderRegister, 16> registers{};
    for (std::uint32_t r = 0; r < registers.size(); ++r) registers[r] = ShaderRegister{0x8c + r + (r / 4) * 8, r};
    measure("sceAgcCbSetShRegistersDirect(16, 4 runs)", Iterations, [&](std::uint64_t i) {
        registers[0].value = static_cast<std::uint32_t>(i);
        sceAgcCbSetShRegistersDirect(&buffer, registers.data(), static_cast<std::uint32_t>(registers.size()));
    });
    measure("sceAgcCbSetUcRegistersDirect(16, 4 runs)", Iterations, [&](std::uint64_t i) {
        registers[0].value = static_cast<std::uint32_t>(i);
        sceAgcCbSetUcRegistersDirect(&buffer, registers.data(), static_cast<std::uint32_t>(registers.size()));
    });
    std::array<std::uint32_t, 4> payload{};
    measure("sceAgcDcbWriteData(4)", Iterations, [&](std::uint64_t i) {
        payload[0] = static_cast<std::uint32_t>(i);
        sceAgcDcbWriteData(&buffer, 5, 0, 0x2000, payload.data(), static_cast<std::uint32_t>(payload.size()), 1, 0);
    });
    LibcRunShutdown_nid_postfix();
    return 0;
}

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 621.14 (32.0.16.2114), Windows 11 Pro 26300
  • AI-assisted: yes

WriteData copies the caller's payload before Allocate, because the
out-of-space callback may rewrite or move the memory it points into.
The copy was a std::vector, so every sceAgcDcbWriteData and
sceAgcAcbWriteData call made one heap allocation. Payloads of up to 64
dwords are now copied into stack storage and larger ones into a heap
buffer, still before the callback runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added agc libSceAgc* perf Performance change perf numbers missing perf pull request without a before and after summary line labels Nov 14, 2026
@github-actions

Copy link
Copy Markdown

This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

@JJenkx

JJenkx commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Windows check of head d36ce95e83. Setup: Windows 11 Enterprise 22621, AMD RX 6700 XT, AMD driver 26.10.1, MinGW-w64 GCC 15.2 UCRT, Release.

agc_copy_data:

  • GPU, through the shared Windows GPU FIFO with ANYPS5_REQUIRE_VULKAN=1, merged onto main 256e5c9389 (merge 4814d30399): passed in 3 of 3 runs. The binary matched the hash recorded at preparation, and the receipt shows exit 0 and app_count=0.
  • CPU, Vulkan hidden, merged onto main fdeac00ec2 (merge 87d7a006f8): passed in 3 of 3 runs.

This is a correctness check only; I did not measure the performance effect.

AI-assisted: yes.

@github-actions

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 19191 core/libs/prx/libSceAgc/Command/src/Memory.cpp

@AlexFigas

Copy link
Copy Markdown
Contributor Author

Performance captures for head d36ce95e83, as the perf label asks.

Setup: ASTRO BOT (PPSA21564, content 01.007.000), Windows 11 Pro 26300, Ryzen 5 9600X, NVIDIA GeForce RTX 5070 Ti (driver 621.14), 3840x2160, Release, warm shader cache (0 misses). Same relinked app.exe and the same 416 libraries in every run. Only libSceAgc.prx was swapped, built from main c9a1545e8c and from this PR. APS5_TRACE_SECONDS=200:20, no input, so the title stays in the scene it reaches on its own. Runs alternate main then change, three pairs.

run first present presents p50 ms p90 ms p99 ms max ms GPU busy ms/present
main-1 5026 444 45.0 46.7 53.6 61.9 38.0
change-1 4732 465 43.0 44.4 45.9 46.6 36.7
main-2 4894 462 43.3 44.7 46.3 55.8 36.3
change-2 5410 471 42.5 43.6 44.6 46.3 36.2
main-3 4992 469 42.7 44.0 45.1 50.3 35.9
change-3 5032 474 42.3 43.5 44.9 47.1 35.9

Result: no frame-time change I can claim. The change is never slower, but the paired p50 gap shrinks from 2.0 to 0.8 to 0.4 ms. GPU busy time per present is the same, and main always ran first in each pair. That looks like warm-up drift between runs, not this change. The saving per sceAgcDcbWriteData/sceAgcAcbWriteData call is about 20 ns (microbenchmark in the PR description), and this scene is GPU- and memory_wait-bound. Every capture reports dropped: yes (the queue worker's event buffer filled). Summary statistics are unaffected; slice inventories cover retained events only.

The traces are 4.3 to 4.4 MB each; I can attach them on request.

main-3 aps5-summary.jsonl line
{"commit":"d36ce95e83f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:20"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 200:20","first_present":4992,"ms":20018.474},"presents":469,"frame_ms":{"p50":42.748,"p90":44.013,"p99":45.137,"max":50.305},"gpu_busy_ms_per_present":35.894,"worker_busy_pct":{"queue worker 0x0":99.007,"queue worker 0x40":99.778,"queue worker 0x48":94.633,"queue worker 0x3a":0.000},"phase_totals_ms":{"Driver.Completion":37.448,"Driver.Dispatch":3264.264,"Driver.Dispatch.capture_resources":261.852,"Driver.Dispatch.decode_key_device_setup":54.565,"Driver.Dispatch.lookup_cache":64.215,"Driver.Dispatch.materialize":10.335,"Driver.Dispatch.prepared_invocation":8.976,"Driver.Draw":5257.650,"Driver.Draw.device_setup":94.636,"Driver.Draw.draw_enqueued":2823.234,"Driver.Draw.post_compile_prepare":26.573,"Driver.Draw.prepare":242.172,"Driver.Draw.shader_compile_and_link":1877.595,"Driver.EndSubmission":369.010,"Driver.Packet":58331.121,"Driver.Packet.device_lock":62.910,"Driver.Packet.dispatch":4189.739,"Driver.Packet.draw":5283.647,"Driver.Packet.execute":532.686,"Driver.Packet.flip_flush":15.740,"Driver.Packet.flush_between_packets":538.022,"Driver.Packet.memory_wait":37385.252,"Driver.Packet.pipeline_drain":116.701,"Driver.Packet.pipeline_prepare":78.301,"Driver.Packet.prepare_memory":7637.726,"Driver.Packet.rendering_wait":0.487,"Driver.Present":1485.467,"Driver.Present.acquire_image":6.387,"Driver.Present.device_setup":0.161,"Driver.Present.gpu_mutex_wait":0.774,"Driver.Present.inflight_wait":1.125,"Driver.Present.present_display_buffer":65.464,"Driver.Present.queue_present":169.123,"Driver.Present.release_and_callback":0.535,"Driver.Present.render_fence_wait":1240.710,"Driver.Present.resize":0.794,"Driver.Present.validate":0.171,"Driver.Suspend":0.153,"GpuMutex.wait.dispatch":428.711,"GpuMutex.wait.draw":477.742,"GpuMutex.wait.end":142.736,"GpuMutex.wait.fill":68.660,"GpuMutex.wait.flush":81.874,"GpuMutex.wait.hook":0.554,"GpuMutex.wait.indirect":0.000,"GpuMutex.wait.label":297.053,"GpuMutex.wait.present":0.003,"GpuMutex.wait.wait":173.638,"Graphics.Draw":4668.918,"Graphics.Draw.draw_and_resource_release":4255.140,"Graphics.Draw.index_upload":98.382,"Graphics.Draw.validate":178.998,"Graphics.Draw.vertex_upload":110.043,"Graphics.DrawWithRecipe":30.174,"Graphics.DrawWithRecipe.draw_and_resource_release":28.108,"Graphics.DrawWithRecipe.index_upload":0.039,"Graphics.DrawWithRecipe.validate":0.337,"Graphics.DrawWithRecipe.vertex_upload":1.492,"Recorder.Reap":370.232,"Recorder.Submit":796.527,"Recorder.WaitSerial":6975.101,"Resources.Complete":366.107,"Resources.Prepare":736.961,"Shader.DrawStage":1411.467,"Shader.DrawStage.capture_resources":1059.201,"Shader.DrawStage.materialize":206.851,"Shader.DrawStage.prepared_invocation":137.812,"Shader.ResolveAbi":48.185,"Shader.ResolveGraphicsAbi":21.304,"Shader.ResolveGraphicsStagesAbi":172.854,"VideoOut.Flip":1520.221,"VideoOut.Flip.completion_mutex_wait":0.500,"VideoOut.Flip.config_mutex_wait":0.044,"VideoOut.Flip.frame_limit":0.242,"VideoOut.Flip.notify_game":6.533,"VideoOut.Flip.present":1483.177,"VideoOut.Flip.validate":0.500,"VideoOut.Flip.vblank_wait":0.299,"VideoOut.Flip.window_prepare":0.737,"VideoOut.Flip.window_title":27.938,"VideoOut.Readiness":1.055,"VideoOut.Readiness.locks_validate":0.411,"Vulkan.Acquire":5.923,"Vulkan.Acquire.acquire_fence_wait":0.838,"Vulkan.Acquire.acquire_image":3.966,"Vulkan.Acquire.fence_reset":0.771,"Vulkan.Acquire.retired_swapchains":0.212,"Vulkan.Dispatch":1427.050,"Vulkan.Dispatch.command_record":297.323,"Vulkan.Dispatch.shader_resources":1125.212,"Vulkan.DispatchRecipe":64.736,"Vulkan.DispatchRecipe.command_record":64.297,"Vulkan.DrawFromRecipe":30.436,"Vulkan.Present":45.576,"Vulkan.Present.command_record_scale":21.205,"Vulkan.Present.pixel_upload":0.822,"Vulkan.Present.queue_submit":23.253,"Vulkan.QueuePresent":168.505,"Vulkan.QueuePresent.queue_present":167.803,"Vulkan.Retire":1240.503,"Vulkan.Retire.wait":1232.649},"top_phases_ms_per_frame":{"Driver.Packet":124.373,"Driver.Packet.memory_wait":79.713,"Driver.Packet.prepare_memory":16.285,"Recorder.WaitSerial":14.872,"Driver.Packet.draw":11.266,"Driver.Draw":11.210,"Graphics.Draw":9.955,"Graphics.Draw.draw_and_resource_release":9.073},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":5628,"Graphics.Barrier.dcc-clear":5628,"Graphics.Barrier.dcc-keys":5628,"Graphics.Barrier.dispatch-lead":35087,"Graphics.Barrier.dispatch-trail":30485,"Graphics.Barrier.draw":54676,"Graphics.Barrier.fill":13343,"Graphics.Barrier.fill-clear":6566,"Graphics.Barrier.indirect-args":3283,"Graphics.Barrier.label-run":77063,"Graphics.Barrier.present-blit":938,"Graphics.Barrier.shadow-publish":2814,"Graphics.Barrier.staging-in":11706,"Graphics.Barrier.staging-out":3752,"Graphics.Barrier.storage-upload":15946,"Graphics.Barrier.storage-writeback":66598,"Graphics.BarrierMerged.dispatch-lead":1964,"Graphics.BarrierMerged.fill":3541,"Graphics.BarrierMerged.label-run":21,"Graphics.BarrierMerged.shadow-publish":1876,"Graphics.BarrierMerged.staging-in":482,"Graphics.BarrierMerged.staging-out":3752,"Graphics.BarrierMerged.storage-writeback":10945,"Graphics.Copy":24253,"Graphics.Copy.bytes":22725712344,"Graphics.RenderPass":21910,"Graphics.RenderPass.Close.command":8084,"Graphics.RenderPass.Close.image":2360,"Graphics.RenderPass.Close.key":1092,"Graphics.RenderPass.Close.label":21,"Graphics.RenderPass.Close.new-batch":10353,"Graphics.RenderPass.Continued":96847},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.310,"events_lost":143457,"totals_full":false}},"trace":"aps5-trace-d36ce95e83f4-13220.json.gz"}
change-3 aps5-summary.jsonl line
{"commit":"d36ce95e83f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:20"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 200:20","first_present":5032,"ms":20039.253},"presents":474,"frame_ms":{"p50":42.293,"p90":43.477,"p99":44.922,"max":47.144},"gpu_busy_ms_per_present":35.907,"worker_busy_pct":{"queue worker 0x0":99.006,"queue worker 0x40":99.791,"queue worker 0x48":93.978,"queue worker 0x3a":0.000},"phase_totals_ms":{"Driver.Completion":35.728,"Driver.Dispatch":3276.143,"Driver.Dispatch.capture_resources":273.685,"Driver.Dispatch.decode_key_device_setup":55.698,"Driver.Dispatch.lookup_cache":64.534,"Driver.Dispatch.materialize":10.183,"Driver.Dispatch.prepared_invocation":8.828,"Driver.Draw":4952.575,"Driver.Draw.device_setup":97.582,"Driver.Draw.draw_enqueued":2524.315,"Driver.Draw.post_compile_prepare":24.735,"Driver.Draw.prepare":241.939,"Driver.Draw.shader_compile_and_link":1867.426,"Driver.EndSubmission":362.098,"Driver.Packet":58271.913,"Driver.Packet.device_lock":63.214,"Driver.Packet.dispatch":4209.849,"Driver.Packet.draw":4979.295,"Driver.Packet.execute":558.606,"Driver.Packet.flip_flush":15.801,"Driver.Packet.flush_between_packets":582.566,"Driver.Packet.memory_wait":37252.900,"Driver.Packet.pipeline_drain":119.938,"Driver.Packet.pipeline_prepare":79.286,"Driver.Packet.prepare_memory":7925.086,"Driver.Packet.rendering_wait":0.507,"Driver.Present":1668.285,"Driver.Present.acquire_image":6.225,"Driver.Present.device_setup":0.158,"Driver.Present.gpu_mutex_wait":0.765,"Driver.Present.inflight_wait":1.139,"Driver.Present.present_display_buffer":64.549,"Driver.Present.queue_present":166.776,"Driver.Present.release_and_callback":0.536,"Driver.Present.render_fence_wait":1426.978,"Driver.Present.resize":0.798,"Driver.Present.validate":0.139,"Driver.Suspend":0.135,"GpuMutex.wait.dispatch":407.578,"GpuMutex.wait.draw":480.710,"GpuMutex.wait.end":167.284,"GpuMutex.wait.fill":77.895,"GpuMutex.wait.flush":84.016,"GpuMutex.wait.hook":0.017,"GpuMutex.wait.indirect":0.001,"GpuMutex.wait.label":293.191,"GpuMutex.wait.present":0.007,"GpuMutex.wait.wait":124.314,"Graphics.Draw":4643.904,"Graphics.Draw.draw_and_resource_release":4234.690,"Graphics.Draw.index_upload":98.033,"Graphics.Draw.validate":175.780,"Graphics.Draw.vertex_upload":109.418,"Graphics.DrawWithRecipe":31.770,"Graphics.DrawWithRecipe.draw_and_resource_release":29.535,"Graphics.DrawWithRecipe.index_upload":0.051,"Graphics.DrawWithRecipe.validate":0.389,"Graphics.DrawWithRecipe.vertex_upload":1.555,"Recorder.Reap":365.487,"Recorder.Submit":779.830,"Recorder.WaitSerial":7369.798,"Resources.Complete":378.179,"Resources.Prepare":725.901,"Shader.DrawStage":1401.151,"Shader.DrawStage.capture_resources":1057.699,"Shader.DrawStage.materialize":205.388,"Shader.DrawStage.prepared_invocation":130.349,"Shader.ResolveAbi":49.534,"Shader.ResolveGraphicsAbi":24.270,"Shader.ResolveGraphicsStagesAbi":180.905,"VideoOut.Flip":1721.233,"VideoOut.Flip.completion_mutex_wait":0.504,"VideoOut.Flip.config_mutex_wait":0.036,"VideoOut.Flip.frame_limit":0.247,"VideoOut.Flip.notify_game":23.447,"VideoOut.Flip.present":1666.789,"VideoOut.Flip.validate":0.470,"VideoOut.Flip.vblank_wait":0.318,"VideoOut.Flip.window_prepare":0.746,"VideoOut.Flip.window_title":28.289,"VideoOut.Readiness":1.049,"VideoOut.Readiness.locks_validate":0.421,"Vulkan.Acquire":5.778,"Vulkan.Acquire.acquire_fence_wait":0.766,"Vulkan.Acquire.acquire_image":3.879,"Vulkan.Acquire.fence_reset":0.822,"Vulkan.Acquire.retired_swapchains":0.182,"Vulkan.Dispatch":1444.401,"Vulkan.Dispatch.command_record":303.407,"Vulkan.Dispatch.shader_resources":1136.280,"Vulkan.DispatchRecipe":64.556,"Vulkan.DispatchRecipe.command_record":64.155,"Vulkan.DrawFromRecipe":32.106,"Vulkan.Present":44.834,"Vulkan.Present.command_record_scale":20.702,"Vulkan.Present.pixel_upload":0.831,"Vulkan.Present.queue_submit":22.997,"Vulkan.QueuePresent":166.175,"Vulkan.QueuePresent.queue_present":165.468,"Vulkan.Retire":1426.808,"Vulkan.Retire.wait":1418.899},"top_phases_ms_per_frame":{"Driver.Packet":122.937,"Driver.Packet.memory_wait":78.593,"Driver.Packet.prepare_memory":16.720,"Recorder.WaitSerial":15.548,"Driver.Packet.draw":10.505,"Driver.Draw":10.448,"Graphics.Draw":9.797,"Graphics.Draw.draw_and_resource_release":8.934},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":5688,"Graphics.Barrier.dcc-clear":5688,"Graphics.Barrier.dcc-keys":5688,"Graphics.Barrier.dispatch-lead":35452,"Graphics.Barrier.dispatch-trail":30810,"Graphics.Barrier.draw":55349,"Graphics.Barrier.fill":13466,"Graphics.Barrier.fill-clear":6636,"Graphics.Barrier.indirect-args":3318,"Graphics.Barrier.label-run":77815,"Graphics.Barrier.present-blit":948,"Graphics.Barrier.shadow-publish":2844,"Graphics.Barrier.staging-in":11811,"Graphics.Barrier.staging-out":3792,"Graphics.Barrier.storage-upload":16116,"Graphics.Barrier.storage-writeback":67308,"Graphics.BarrierMerged.dispatch-lead":1994,"Graphics.BarrierMerged.fill":3598,"Graphics.BarrierMerged.label-run":24,"Graphics.BarrierMerged.shadow-publish":1896,"Graphics.BarrierMerged.staging-in":505,"Graphics.BarrierMerged.staging-out":3792,"Graphics.BarrierMerged.storage-writeback":11035,"Graphics.Copy":24517,"Graphics.Copy.bytes":22967990752,"Graphics.RenderPass":22199,"Graphics.RenderPass.Close.command":8273,"Graphics.RenderPass.Close.image":2383,"Graphics.RenderPass.Close.key":1092,"Graphics.RenderPass.Close.label":24,"Graphics.RenderPass.Close.new-batch":10427,"Graphics.RenderPass.Continued":98891},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.851,"events_lost":123394,"totals_full":false}},"trace":"aps5-trace-d36ce95e83f4-20688.json.gz"}
main-3 trace_digest.py

seconds 200:20 from present 4992: 469 presents, frame p50 42.7 / p90 44.0 / p99 45.1 / max 50.3 ms, GPU busy 35.9 ms per present
NVIDIA GeForce RTX 5070 Ti, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit d36ce95, dropped: yes

{"commit":"d36ce95e83f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:20"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 200:20","first_present":4992,"ms":20018.474},"presents":469,"frame_ms":{"p50":42.748,"p90":44.013,"p99":45.137,"max":50.305},"gpu_busy_ms_per_present":35.894,"worker_busy_pct":{"queue worker 0x0":99.007,"queue worker 0x40":99.778,"queue worker 0x48":94.633,"queue worker 0x3a":0.0},"phase_totals_ms":{"Driver.Completion":37.448,"Driver.Dispatch":3264.264,"Driver.Dispatch.capture_resources":261.852,"Driver.Dispatch.decode_key_device_setup":54.565,"Driver.Dispatch.lookup_cache":64.215,"Driver.Dispatch.materialize":10.335,"Driver.Dispatch.prepared_invocation":8.976,"Driver.Draw":5257.65,"Driver.Draw.device_setup":94.636,"Driver.Draw.draw_enqueued":2823.234,"Driver.Draw.post_compile_prepare":26.573,"Driver.Draw.prepare":242.172,"Driver.Draw.shader_compile_and_link":1877.595,"Driver.EndSubmission":369.01,"Driver.Packet":58331.121,"Driver.Packet.device_lock":62.91,"Driver.Packet.dispatch":4189.739,"Driver.Packet.draw":5283.647,"Driver.Packet.execute":532.686,"Driver.Packet.flip_flush":15.74,"Driver.Packet.flush_between_packets":538.022,"Driver.Packet.memory_wait":37385.252,"Driver.Packet.pipeline_drain":116.701,"Driver.Packet.pipeline_prepare":78.301,"Driver.Packet.prepare_memory":7637.726,"Driver.Packet.rendering_wait":0.487,"Driver.Present":1485.467,"Driver.Present.acquire_image":6.387,"Driver.Present.device_setup":0.161,"Driver.Present.gpu_mutex_wait":0.774,"Driver.Present.inflight_wait":1.125,"Driver.Present.present_display_buffer":65.464,"Driver.Present.queue_present":169.123,"Driver.Present.release_and_callback":0.535,"Driver.Present.render_fence_wait":1240.71,"Driver.Present.resize":0.794,"Driver.Present.validate":0.171,"Driver.Suspend":0.153,"GpuMutex.wait.dispatch":428.711,"GpuMutex.wait.draw":477.742,"GpuMutex.wait.end":142.736,"GpuMutex.wait.fill":68.66,"GpuMutex.wait.flush":81.874,"GpuMutex.wait.hook":0.554,"GpuMutex.wait.indirect":0.0,"GpuMutex.wait.label":297.053,"GpuMutex.wait.present":0.003,"GpuMutex.wait.wait":173.638,"Graphics.Draw":4668.918,"Graphics.Draw.draw_and_resource_release":4255.14,"Graphics.Draw.index_upload":98.382,"Graphics.Draw.validate":178.998,"Graphics.Draw.vertex_upload":110.043,"Graphics.DrawWithRecipe":30.174,"Graphics.DrawWithRecipe.draw_and_resource_release":28.108,"Graphics.DrawWithRecipe.index_upload":0.039,"Graphics.DrawWithRecipe.validate":0.337,"Graphics.DrawWithRecipe.vertex_upload":1.492,"Recorder.Reap":370.232,"Recorder.Submit":796.527,"Recorder.WaitSerial":6975.101,"Resources.Complete":366.107,"Resources.Prepare":736.961,"Shader.DrawStage":1411.467,"Shader.DrawStage.capture_resources":1059.201,"Shader.DrawStage.materialize":206.851,"Shader.DrawStage.prepared_invocation":137.812,"Shader.ResolveAbi":48.185,"Shader.ResolveGraphicsAbi":21.304,"Shader.ResolveGraphicsStagesAbi":172.854,"VideoOut.Flip":1520.221,"VideoOut.Flip.completion_mutex_wait":0.5,"VideoOut.Flip.config_mutex_wait":0.044,"VideoOut.Flip.frame_limit":0.242,"VideoOut.Flip.notify_game":6.533,"VideoOut.Flip.present":1483.177,"VideoOut.Flip.validate":0.5,"VideoOut.Flip.vblank_wait":0.299,"VideoOut.Flip.window_prepare":0.737,"VideoOut.Flip.window_title":27.938,"VideoOut.Readiness":1.055,"VideoOut.Readiness.locks_validate":0.411,"Vulkan.Acquire":5.923,"Vulkan.Acquire.acquire_fence_wait":0.838,"Vulkan.Acquire.acquire_image":3.966,"Vulkan.Acquire.fence_reset":0.771,"Vulkan.Acquire.retired_swapchains":0.212,"Vulkan.Dispatch":1427.05,"Vulkan.Dispatch.command_record":297.323,"Vulkan.Dispatch.shader_resources":1125.212,"Vulkan.DispatchRecipe":64.736,"Vulkan.DispatchRecipe.command_record":64.297,"Vulkan.DrawFromRecipe":30.436,"Vulkan.Present":45.576,"Vulkan.Present.command_record_scale":21.205,"Vulkan.Present.pixel_upload":0.822,"Vulkan.Present.queue_submit":23.253,"Vulkan.QueuePresent":168.505,"Vulkan.QueuePresent.queue_present":167.803,"Vulkan.Retire":1240.503,"Vulkan.Retire.wait":1232.649},"top_phases_ms_per_frame":{"Driver.Packet":124.373,"Driver.Packet.memory_wait":79.713,"Driver.Packet.prepare_memory":16.285,"Recorder.WaitSerial":14.872,"Driver.Packet.draw":11.266,"Driver.Draw":11.21,"Graphics.Draw":9.955,"Graphics.Draw.draw_and_resource_release":9.073},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":5628,"Graphics.Barrier.dcc-clear":5628,"Graphics.Barrier.dcc-keys":5628,"Graphics.Barrier.dispatch-lead":35087,"Graphics.Barrier.dispatch-trail":30485,"Graphics.Barrier.draw":54676,"Graphics.Barrier.fill":13343,"Graphics.Barrier.fill-clear":6566,"Graphics.Barrier.indirect-args":3283,"Graphics.Barrier.label-run":77063,"Graphics.Barrier.present-blit":938,"Graphics.Barrier.shadow-publish":2814,"Graphics.Barrier.staging-in":11706,"Graphics.Barrier.staging-out":3752,"Graphics.Barrier.storage-upload":15946,"Graphics.Barrier.storage-writeback":66598,"Graphics.BarrierMerged.dispatch-lead":1964,"Graphics.BarrierMerged.fill":3541,"Graphics.BarrierMerged.label-run":21,"Graphics.BarrierMerged.shadow-publish":1876,"Graphics.BarrierMerged.staging-in":482,"Graphics.BarrierMerged.staging-out":3752,"Graphics.BarrierMerged.storage-writeback":10945,"Graphics.Copy":24253,"Graphics.Copy.bytes":22725712344,"Graphics.RenderPass":21910,"Graphics.RenderPass.Close.command":8084,"Graphics.RenderPass.Close.image":2360,"Graphics.RenderPass.Close.key":1092,"Graphics.RenderPass.Close.label":21,"Graphics.RenderPass.Close.new-batch":10353,"Graphics.RenderPass.Continued":96847},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.31,"events_lost":143457,"totals_full":false}},"trace":"aps5-trace-d36ce95e83f4-13220.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 143457 events lost; buffer full at 13310.4 ms

Slowest frames (largest slices inside each, inclusive)

  • present 5078: 50.3 ms at 3620 ms: Driver.Packet (queue worker 0x40) 49.7, Driver.Packet (queue worker 0x48) 46.3, Driver.Packet (queue worker 0x0) 45.6, Driver.Packet.memory_wait (queue worker 0x48) 44.4
  • present 5447: 47.1 ms at 19413 ms: Driver.Packet (queue worker 0x40) 46.5, Driver.Packet (queue worker 0x48) 43.0, Driver.Packet.memory_wait (queue worker 0x48) 41.3, batch (gpu) 36.9
  • present 5272: 46.4 ms at 11844 ms: Driver.Packet (queue worker 0x40) 45.8, Driver.Packet (queue worker 0x48) 43.6, Driver.Packet.memory_wait (queue worker 0x48) 42.0, Driver.Packet (queue worker 0x0) 41.7
  • present 5427: 46.0 ms at 18551 ms: Driver.Packet (queue worker 0x40) 44.4, Driver.Packet (queue worker 0x48) 41.9, Driver.Packet.memory_wait (queue worker 0x48) 39.7, batch (gpu) 38.2
  • present 5451: 45.1 ms at 19587 ms: Driver.Packet (queue worker 0x40) 44.5, Driver.Packet (queue worker 0x48) 41.9, Driver.Packet.memory_wait (queue worker 0x48) 39.9, batch (gpu) 37.5

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 5078: 50.3 ms at 3620 ms, persistence 10.7 ms
  • present 5447: 47.1 ms at 19413 ms, persistence 7.5 ms
  • present 5272: 46.4 ms at 11844 ms, persistence 5.8 ms
  • present 5088: 45.1 ms at 4043 ms, persistence 5.4 ms
  • present 5427: 46.0 ms at 18551 ms, persistence 5.3 ms
  • present 5204: 44.7 ms at 8921 ms, persistence 5.0 ms
  • present 5451: 45.1 ms at 19587 ms, persistence 3.9 ms
  • present 5208: 45.1 ms at 9090 ms, persistence 3.8 ms
  • present 5130: 43.6 ms at 5796 ms, persistence 3.7 ms
  • present 5068: 44.2 ms at 3200 ms, persistence 3.7 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 13.5 (32 %) 11.9 (28 %) 17.2 11.2 Driver.Packet 25.4, Driver.Completion 0.0
title 0.0 (0 %) 0.0 (0 %) 42.7 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 42.7 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 42.7 0.1 Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 3.2 (8 %) 39.5 0.3 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
queue worker 0x40 5.8 (13 %) 36.3 (85 %) 0.6 1.9 Driver.Packet 42.0, Driver.EndSubmission 0.1
queue worker 0x48 1.6 (4 %) 40.9 (96 %) 0.1 0.1 Driver.Packet 39.7, Driver.EndSubmission 0.7
draw committer 9.3 (22 %) 1.9 (4 %) 31.5 5.7 Graphics.Draw 8.2, Recorder.Submit 0.9
presenter 0.6 (1 %) 2.6 (6 %) 39.4 0.1 VideoOut.Flip 3.2, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 42.7 0.0 Shader.ResolveGraphicsStagesAbi 0.0
gpu 35.9 (84 %) 0.0 (0 %) 6.8 0.0 batch 35.9

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 107.1, Driver.Packet.memory_wait 73.8, batch 35.9, Driver.Packet.prepare_memory 16.1, Recorder.WaitSerial 14.9, Graphics.Draw 8.2, Graphics.Draw.draw_and_resource_release 7.5, Driver.Packet.dispatch 6.7, Driver.Packet.draw 6.6, Driver.Draw 6.6

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x48) 44.2 ms at 3627 ms, present 5078
  • Driver.Packet.memory_wait (queue worker 0x48) 42.0 ms at 11849 ms, present 5272
  • Driver.Packet.memory_wait (queue worker 0x48) 41.7 ms at 14877 ms, present 5342
  • Driver.Packet.memory_wait (queue worker 0x48) 41.6 ms at 14921 ms, present 5343
  • Driver.Packet.memory_wait (queue worker 0x48) 41.6 ms at 3203 ms, present 5068
  • Driver.Packet.memory_wait (queue worker 0x48) 41.4 ms at 1474 ms, present 5027
  • Driver.Packet.memory_wait (queue worker 0x48) 41.2 ms at 19419 ms, present 5447
  • Driver.Packet.memory_wait (queue worker 0x48) 41.0 ms at 15699 ms, present 5361
  • Driver.Packet.memory_wait (queue worker 0x48) 40.9 ms at 12456 ms, present 5286
  • Driver.Packet.memory_wait (queue worker 0x48) 40.9 ms at 14140 ms, present 5325

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 4711: 12.9 ms at 2871 ms, present 5060: GPU no ranges; recorded by Recorder.Reap (draw committer) 0.2, GpuMutex.wait.label (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1
  • batch 30995: 12.8 ms at 19115 ms, present 5440: GPU no ranges; recorded by GpuMutex.wait.flush (draw committer) 1.3, Recorder.Reap (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1
  • batch 18123: 12.7 ms at 11066 ms, present 5254: GPU no ranges; recorded by GpuMutex.wait.label (draw committer) 0.2, Recorder.Reap (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1
  • batch 7695: 12.6 ms at 4675 ms, present 5103: GPU no ranges; recorded by Recorder.Submit (draw committer) 0.3, GpuMutex.wait.label (draw committer) 0.2, Recorder.Reap (draw committer) 0.1, Graphics.Draw (draw committer) 0.1
  • batch 27947: 12.6 ms at 17220 ms, present 5396: GPU no ranges; recorded by Recorder.Reap (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1, GpuMutex.wait.label (draw committer) 0.1
change-3 trace_digest.py

seconds 200:20 from present 5032: 474 presents, frame p50 42.3 / p90 43.5 / p99 44.9 / max 47.1 ms, GPU busy 35.9 ms per present
NVIDIA GeForce RTX 5070 Ti, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit d36ce95, dropped: yes

{"commit":"d36ce95e83f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:20"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 200:20","first_present":5032,"ms":20039.253},"presents":474,"frame_ms":{"p50":42.293,"p90":43.477,"p99":44.922,"max":47.144},"gpu_busy_ms_per_present":35.907,"worker_busy_pct":{"queue worker 0x0":99.006,"queue worker 0x40":99.791,"queue worker 0x48":93.978,"queue worker 0x3a":0.0},"phase_totals_ms":{"Driver.Completion":35.728,"Driver.Dispatch":3276.143,"Driver.Dispatch.capture_resources":273.685,"Driver.Dispatch.decode_key_device_setup":55.698,"Driver.Dispatch.lookup_cache":64.534,"Driver.Dispatch.materialize":10.183,"Driver.Dispatch.prepared_invocation":8.828,"Driver.Draw":4952.575,"Driver.Draw.device_setup":97.582,"Driver.Draw.draw_enqueued":2524.315,"Driver.Draw.post_compile_prepare":24.735,"Driver.Draw.prepare":241.939,"Driver.Draw.shader_compile_and_link":1867.426,"Driver.EndSubmission":362.098,"Driver.Packet":58271.913,"Driver.Packet.device_lock":63.214,"Driver.Packet.dispatch":4209.849,"Driver.Packet.draw":4979.295,"Driver.Packet.execute":558.606,"Driver.Packet.flip_flush":15.801,"Driver.Packet.flush_between_packets":582.566,"Driver.Packet.memory_wait":37252.9,"Driver.Packet.pipeline_drain":119.938,"Driver.Packet.pipeline_prepare":79.286,"Driver.Packet.prepare_memory":7925.086,"Driver.Packet.rendering_wait":0.507,"Driver.Present":1668.285,"Driver.Present.acquire_image":6.225,"Driver.Present.device_setup":0.158,"Driver.Present.gpu_mutex_wait":0.765,"Driver.Present.inflight_wait":1.139,"Driver.Present.present_display_buffer":64.549,"Driver.Present.queue_present":166.776,"Driver.Present.release_and_callback":0.536,"Driver.Present.render_fence_wait":1426.978,"Driver.Present.resize":0.798,"Driver.Present.validate":0.139,"Driver.Suspend":0.135,"GpuMutex.wait.dispatch":407.578,"GpuMutex.wait.draw":480.71,"GpuMutex.wait.end":167.284,"GpuMutex.wait.fill":77.895,"GpuMutex.wait.flush":84.016,"GpuMutex.wait.hook":0.017,"GpuMutex.wait.indirect":0.001,"GpuMutex.wait.label":293.191,"GpuMutex.wait.present":0.007,"GpuMutex.wait.wait":124.314,"Graphics.Draw":4643.904,"Graphics.Draw.draw_and_resource_release":4234.69,"Graphics.Draw.index_upload":98.033,"Graphics.Draw.validate":175.78,"Graphics.Draw.vertex_upload":109.418,"Graphics.DrawWithRecipe":31.77,"Graphics.DrawWithRecipe.draw_and_resource_release":29.535,"Graphics.DrawWithRecipe.index_upload":0.051,"Graphics.DrawWithRecipe.validate":0.389,"Graphics.DrawWithRecipe.vertex_upload":1.555,"Recorder.Reap":365.487,"Recorder.Submit":779.83,"Recorder.WaitSerial":7369.798,"Resources.Complete":378.179,"Resources.Prepare":725.901,"Shader.DrawStage":1401.151,"Shader.DrawStage.capture_resources":1057.699,"Shader.DrawStage.materialize":205.388,"Shader.DrawStage.prepared_invocation":130.349,"Shader.ResolveAbi":49.534,"Shader.ResolveGraphicsAbi":24.27,"Shader.ResolveGraphicsStagesAbi":180.905,"VideoOut.Flip":1721.233,"VideoOut.Flip.completion_mutex_wait":0.504,"VideoOut.Flip.config_mutex_wait":0.036,"VideoOut.Flip.frame_limit":0.247,"VideoOut.Flip.notify_game":23.447,"VideoOut.Flip.present":1666.789,"VideoOut.Flip.validate":0.47,"VideoOut.Flip.vblank_wait":0.318,"VideoOut.Flip.window_prepare":0.746,"VideoOut.Flip.window_title":28.289,"VideoOut.Readiness":1.049,"VideoOut.Readiness.locks_validate":0.421,"Vulkan.Acquire":5.778,"Vulkan.Acquire.acquire_fence_wait":0.766,"Vulkan.Acquire.acquire_image":3.879,"Vulkan.Acquire.fence_reset":0.822,"Vulkan.Acquire.retired_swapchains":0.182,"Vulkan.Dispatch":1444.401,"Vulkan.Dispatch.command_record":303.407,"Vulkan.Dispatch.shader_resources":1136.28,"Vulkan.DispatchRecipe":64.556,"Vulkan.DispatchRecipe.command_record":64.155,"Vulkan.DrawFromRecipe":32.106,"Vulkan.Present":44.834,"Vulkan.Present.command_record_scale":20.702,"Vulkan.Present.pixel_upload":0.831,"Vulkan.Present.queue_submit":22.997,"Vulkan.QueuePresent":166.175,"Vulkan.QueuePresent.queue_present":165.468,"Vulkan.Retire":1426.808,"Vulkan.Retire.wait":1418.899},"top_phases_ms_per_frame":{"Driver.Packet":122.937,"Driver.Packet.memory_wait":78.593,"Driver.Packet.prepare_memory":16.72,"Recorder.WaitSerial":15.548,"Driver.Packet.draw":10.505,"Driver.Draw":10.448,"Graphics.Draw":9.797,"Graphics.Draw.draw_and_resource_release":8.934},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":5688,"Graphics.Barrier.dcc-clear":5688,"Graphics.Barrier.dcc-keys":5688,"Graphics.Barrier.dispatch-lead":35452,"Graphics.Barrier.dispatch-trail":30810,"Graphics.Barrier.draw":55349,"Graphics.Barrier.fill":13466,"Graphics.Barrier.fill-clear":6636,"Graphics.Barrier.indirect-args":3318,"Graphics.Barrier.label-run":77815,"Graphics.Barrier.present-blit":948,"Graphics.Barrier.shadow-publish":2844,"Graphics.Barrier.staging-in":11811,"Graphics.Barrier.staging-out":3792,"Graphics.Barrier.storage-upload":16116,"Graphics.Barrier.storage-writeback":67308,"Graphics.BarrierMerged.dispatch-lead":1994,"Graphics.BarrierMerged.fill":3598,"Graphics.BarrierMerged.label-run":24,"Graphics.BarrierMerged.shadow-publish":1896,"Graphics.BarrierMerged.staging-in":505,"Graphics.BarrierMerged.staging-out":3792,"Graphics.BarrierMerged.storage-writeback":11035,"Graphics.Copy":24517,"Graphics.Copy.bytes":22967990752,"Graphics.RenderPass":22199,"Graphics.RenderPass.Close.command":8273,"Graphics.RenderPass.Close.image":2383,"Graphics.RenderPass.Close.key":1092,"Graphics.RenderPass.Close.label":24,"Graphics.RenderPass.Close.new-batch":10427,"Graphics.RenderPass.Continued":98891},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.851,"events_lost":123394,"totals_full":false}},"trace":"aps5-trace-d36ce95e83f4-20688.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 123394 events lost; buffer full at 13850.5 ms

Slowest frames (largest slices inside each, inclusive)

  • present 5184: 47.1 ms at 6324 ms: Driver.Packet (queue worker 0x40) 46.5, Driver.Packet (queue worker 0x48) 43.6, Driver.Packet (queue worker 0x0) 42.7, Driver.Packet.memory_wait (queue worker 0x48) 41.8
  • present 5335: 45.6 ms at 12748 ms: Driver.Packet (queue worker 0x40) 45.0, Driver.Packet (queue worker 0x48) 42.2, Driver.Packet (queue worker 0x0) 41.4, Driver.Packet.memory_wait (queue worker 0x48) 40.6
  • present 5501: 45.2 ms at 19825 ms: Driver.Packet (queue worker 0x40) 44.3, Driver.Packet (queue worker 0x48) 40.9, Driver.Packet.memory_wait (queue worker 0x48) 39.2, batch (gpu) 37.6
  • present 5441: 45.1 ms at 17278 ms: Driver.Packet (queue worker 0x40) 44.5, Driver.Packet (queue worker 0x48) 44.4, Driver.Packet.memory_wait (queue worker 0x48) 41.1, batch (gpu) 37.5
  • present 5283: 44.9 ms at 10530 ms: Driver.Packet (queue worker 0x40) 44.3, Driver.Packet (queue worker 0x48) 42.4, Driver.Packet (queue worker 0x0) 40.5, Driver.Packet.memory_wait (queue worker 0x48) 39.1

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 5184: 47.1 ms at 6324 ms, persistence 8.2 ms
  • present 5098: 44.4 ms at 2746 ms, persistence 5.5 ms
  • present 5335: 45.6 ms at 12748 ms, persistence 5.4 ms
  • present 5501: 45.2 ms at 19825 ms, persistence 5.2 ms
  • present 5441: 45.1 ms at 17278 ms, persistence 4.5 ms
  • present 5109: 43.1 ms at 3202 ms, persistence 4.0 ms
  • present 5283: 44.9 ms at 10530 ms, persistence 4.0 ms
  • present 5480: 44.6 ms at 18935 ms, persistence 3.8 ms
  • present 5350: 44.8 ms at 13391 ms, persistence 3.7 ms
  • present 5503: 44.2 ms at 19911 ms, persistence 3.7 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 13.5 (32 %) 12.6 (30 %) 16.1 12.3 Driver.Packet 26.1, Driver.Completion 0.0
title 0.0 (0 %) 0.0 (0 %) 42.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 42.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 42.3 0.1 Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 3.4 (8 %) 38.9 0.3 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x40 5.8 (14 %) 35.9 (85 %) 0.6 1.9 Driver.Packet 41.6, Driver.EndSubmission 0.1
queue worker 0x48 1.6 (4 %) 40.5 (96 %) 0.1 0.1 Driver.Packet 39.1, Driver.EndSubmission 0.6
draw committer 9.1 (21 %) 1.9 (4 %) 31.3 5.8 Graphics.Draw 8.0, Recorder.Submit 0.8
presenter 0.6 (1 %) 3.0 (7 %) 38.6 0.1 VideoOut.Flip 3.6, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 42.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0
gpu 36.0 (85 %) 0.0 (0 %) 6.3 0.0 batch 36.0

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 106.8, Driver.Packet.memory_wait 73.0, batch 36.0, Driver.Packet.prepare_memory 16.5, Recorder.WaitSerial 15.5, Graphics.Draw 8.0, Graphics.Draw.draw_and_resource_release 7.3, Driver.Packet.dispatch 6.8, Driver.Packet.draw 6.3, Driver.Draw 6.3

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x48) 42.5 ms at 6330 ms, present 5184
  • Driver.Packet.memory_wait (queue worker 0x48) 41.2 ms at 13693 ms, present 5357
  • Driver.Packet.memory_wait (queue worker 0x48) 41.1 ms at 16727 ms, present 5428
  • Driver.Packet.memory_wait (queue worker 0x48) 41.0 ms at 9720 ms, present 5264
  • Driver.Packet.memory_wait (queue worker 0x48) 40.6 ms at 10491 ms, present 5282
  • Driver.Packet.memory_wait (queue worker 0x48) 40.5 ms at 9807 ms, present 5266
  • Driver.Packet.memory_wait (queue worker 0x48) 40.5 ms at 8400 ms, present 5233
  • Driver.Packet.memory_wait (queue worker 0x48) 40.4 ms at 17284 ms, present 5441
  • Driver.Packet.memory_wait (queue worker 0x48) 40.4 ms at 19575 ms, present 5495
  • Driver.Packet.memory_wait (queue worker 0x48) 40.4 ms at 12754 ms, present 5335

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 11307: 13.2 ms at 6798 ms, present 5195: GPU no ranges; recorded by GpuMutex.wait.label (draw committer) 0.1, Recorder.Reap (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1
  • batch 23301: 13.1 ms at 14207 ms, present 5369: GPU no ranges; recorded by GpuMutex.wait.label (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1, Recorder.Reap (draw committer) 0.1
  • batch 10076: 13.1 ms at 6031 ms, present 5177: GPU no ranges; recorded by GpuMutex.wait.label (draw committer) 0.2, Recorder.Reap (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1
  • batch 26922: 12.9 ms at 16429 ms, present 5421: GPU no ranges; recorded by Recorder.Reap (draw committer) 0.1, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1, GpuMutex.wait.label (draw committer) 0.1
  • batch 16982: 12.9 ms at 10276 ms, present 5277: GPU no ranges; recorded by Recorder.Reap (draw committer) 0.2, Graphics.Draw (draw committer) 0.1, Graphics.Draw.draw_and_resource_release (draw committer) 0.1, GpuMutex.wait.label (draw committer) 0.1

On the overlap note: #19191 changes WritePrimeUtcl2 in Command/src/Memory.cpp; this PR changes only WriteData in that file. The hunks don't touch.

AI-assisted: yes.

@oneandonlydean
oneandonlydean merged commit 07f6b70 into boykopovar:main Nov 14, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* perf numbers missing perf pull request without a before and after summary line perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants